home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / game / patch / WHDIGamesA-B.lzh / AllTerrainRacing.lha / AllTerrainRacingHD / Install < prev    next >
Text File  |  2000-12-17  |  4KB  |  223 lines

  1. ;****************************
  2.  
  3. (set #readme-file "README")    ;name of the readme file
  4.  
  5. (procedure P_MakeImages
  6.  
  7.   ;the following lines must be copied and adjusted for multiple disk images
  8.  
  9.   (set #CI_disknum 1)
  10.   (set #CI_diskname ("%s Disk %ld" @app-name #CI_disknum))
  11.   (set #CI_disklen 433664)
  12.   (set #CI_skiptrk -1)
  13.   (P_CreateImage)
  14.  
  15.   (set #CI_disknum 2)
  16.   (set #CI_diskname ("%s Disk %ld" @app-name #CI_disknum))
  17.   (set #CI_disklen 901120)
  18.   (P_CreateImage)
  19. )
  20.  
  21. ;****************************
  22. ;----------------------------
  23. ; checks if given program is installed, if not abort install
  24. ; #program - to check
  25.  
  26. (procedure P_ChkRun
  27.   (if
  28.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  29.     ("")
  30.     (abort 
  31.       (cat
  32.     "You must install \"" #program "\" first!\n"
  33.     "It must be accessible via the path.\n"
  34.     "You can find it in the WHDLoad package."
  35.       )
  36.     )
  37.   )
  38. )
  39.  
  40. ;----------------------------
  41. ; Create Image using DIC
  42. ; #dest        - path to save image in
  43. ; #CI_disknum  - number of the disk image to create
  44. ; #CI_diskname - label of the disk
  45. ; #CI_disklen  - length of disk image to create
  46. ; #CI_skiptrk  - track to skip, -1 means no skip
  47. ; #CI_drive    - drive to create image from
  48.  
  49. (procedure P_CreateImage
  50.   (message
  51.     (cat
  52.     "\nInsert \"" #CI_diskname "\" into drive " #CI_drive "!\n\n"
  53.     "(make sure it's the right disk because it will not be checked)"
  54.     )
  55.   )
  56.   (if
  57.     (>= #CI_skiptrk 0)
  58.     (set #option (cat " SKIPTRACK=" #CI_skiptrk))
  59.     (set #option "")
  60.   )
  61.   (if
  62.     (= 0
  63.       (run 
  64.         (cat
  65.           "cd \"" #dest "\"\n"
  66.           "DIC " #CI_drive " FD=" #CI_disknum " LD=" #CI_disknum " SIZE="
  67.           #CI_disklen #option " PEDANTIC >CON:///1000//CLOSE"
  68.         )
  69.       )
  70.     )
  71.     (run ("FileNote %s Quiet" #CI_diskname))
  72.     (abort "\"DIC\" has failed to create a diskimage")
  73.   )
  74. )
  75.  
  76. ;****************************
  77.  
  78. (if
  79.   (exists #readme-file)
  80.   (if
  81.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  82.     ("")
  83.     (run ("SYS:Utilities/More %s" #readme-file))
  84.   )
  85. )
  86.  
  87. (set #program "WHDLoad")
  88. (P_ChkRun)
  89.  
  90. (set #program "DIC")
  91. (P_ChkRun)
  92.  
  93. ; in expert mode ask for source drive
  94. (if
  95.   (= @user-level 2)
  96.   (
  97.     (set #CI_drive
  98.       (askchoice
  99.     (prompt "Select source drive for diskimages")
  100.     (default 0)
  101.     (choices "DF0:" "DF1:" "RAD:" "Enter Device")
  102.     (help @askchoice-help)
  103.       )
  104.     )
  105.     (select #CI_drive
  106.       (set #CI_drive "DF0:")
  107.       (set #CI_drive "DF1:")
  108.       (set #CI_drive "RAD:")
  109.       (set #CI_drive
  110.         (askstring
  111.           (prompt "Select source drive for diskimages")
  112.           (default "DF0:")
  113.           (help @askstring-help)
  114.         )
  115.       )
  116.     )
  117.   )
  118.   (set #CI_drive "DF0:")
  119. )
  120.  
  121. (set @default-dest
  122.   (askdir
  123.     (prompt 
  124.       (cat
  125.     "Where should \"" @app-name "\" be installed?\n"
  126.     "A drawer \"" @app-name "\" will be automatically created."
  127.       )
  128.     )
  129.     (help @askdir-help)
  130.     (default @default-dest)
  131.     (disk)
  132.   )
  133. )
  134. (set #dest (tackon @default-dest @app-name))
  135. (if
  136.   (exists #dest)
  137.   (
  138.     (set #choice
  139.       (askbool
  140.         (prompt
  141.           (cat
  142.             "\nDirectory \"" #dest "\" already exists.\n"
  143.             "Should it be deleted?"
  144.           )
  145.         )
  146.         (default 1)
  147.         (choices "Delete" "Skip")
  148.         (help @askbool-help)
  149.       )
  150.     )
  151.     (if
  152.       (= #choice 1)
  153.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  154.     )
  155.   )
  156. )
  157. (makedir #dest
  158.   (help @makedir-help)
  159.   (infos)
  160. )
  161.  
  162. ;----------------------------
  163.  
  164. (copyfiles
  165.   (help @copyfiles-help)
  166.   (source ("%s.Slave" @app-name))
  167.   (dest #dest)
  168. )
  169. (if
  170.   (exists ("%s.newicon" @app-name))
  171.   (set #icon
  172.     (askchoice
  173.       (prompt "\nWhich icon would you like to install?\n")
  174.       (default 0)
  175.       (choices "Normal" "NewIcon" "GlowIcon")
  176.       (help @askchoice-help)
  177.     )
  178.   )
  179.   (set #icon 0)
  180. )
  181. (select #icon
  182.   (set #icon ("%s.inf" @app-name))
  183.   (set #icon ("%s.newicon" @app-name))
  184.   (set #icon ("%s.glowicon" @app-name))
  185. )
  186. (copyfiles
  187.   (help @copyfiles-help)
  188.   (source #icon)
  189.   (newname ("%s.info" @app-name))
  190.   (dest #dest)
  191. )
  192. (if
  193.   (exists #readme-file)
  194.   (copyfiles
  195.     (help @copyfiles-help)
  196.     (source #readme-file)
  197.     (dest #dest)
  198.   )
  199. )
  200. (if
  201.   (exists ("%s.info" #readme-file))
  202.   (copyfiles
  203.     (help @copyfiles-help)
  204.     (source ("%s.info" #readme-file))
  205.     (dest #dest)
  206.   )
  207. )
  208. (if
  209.   (exists ("%s.save" @app-name))
  210.   (copyfiles
  211.     (help @copyfiles-help)
  212.     (source ("%s.save" @app-name))
  213.     (dest #dest)
  214.   )
  215. )
  216.  
  217. (P_MakeImages)
  218.  
  219. ;----------------------------
  220.  
  221. (exit)
  222.  
  223.